<!DOCTYPE html>
<html>
<head th:include="cultivateWeb/header :: culHeaderCss">
</head>
<link rel="stylesheet" href="/css/certificateWeb/workNews/workNews.css">
<link type="text/css" href="/css/cultivateWeb/style/my.css" rel="stylesheet">
<link type="text/css" href="/css/cultivateWeb/style/my.css" rel="stylesheet">
<body>
<!-- 顶部导航 -->
<header th:include="cultivateWeb/header :: header"></header>
<style>
    .right {
        float: right
    }

    .left {
        float: left
    }

    .active1 {
        border-bottom: 2px solid #005C34;
        color: #005C34
    }

    .spanChange:hover {
        cursor: pointer
    }

    .spanChange {
        font-size: 20px;
        margin: 0 30px
    }
</style>
<div style="clear: both"></div>
<div style="background-color: #f7f7f7; ">
    <div class="container">
        <div class="row">
    <div style="height: 40px">
        <p style="line-height: 40px">当前位置：<a href="/cultivate/homepage">首页</a> > 投递记录</p>
    </div>
    <hr style="margin: 0 auto ;"/>
    <section  style="display:flex;background:#F7F7F7;padding-top: 0">
         <div class="col-xs-3" style="height: 850px;padding:0;margin-right:10px;background-color: #fff">
            <ul id="personal_data">
                <li><a href="/cultivate/my">个人资料</a></li>
                <li><a href="/cultivate/myOrder">我的订单</a></li>
<!--                <li><a href="/cultivate/myClasss/myClasss">我的班级</a></li>-->
                <li><a href="/cultivate/myCourse">我的课程</a></li>
                <li><a href="/cultivate/myCoursePlan">我的课程计划</a></li>
                <li><a href="/cultivate/studyRecord">学习记录</a></li>
                <li onclick="recruit()"><a>我的简历</a></li>
                <li class="this"><a href="/cultivate/deliverRecord">投递记录</a></li>
                <li><a href="/cultivate/applyRecord">申请记录</a></li>
                <li><a href="/cultivate/myMessage">消息中心</a></li>
                <li><a href="/cultivate/myCertificates">我的证书</a></li>
                <li onclick="mock2(this)" data-type="2"><a>幼儿照护初级模拟考试</a></li>
                <li onclick="mock2(this)" data-type="1"><a>幼儿照护中级模拟考试</a></li>
                <li onclick="mock2(this)" data-type="0"><a>幼儿照护高级模拟考试</a></li>
            </ul>
        </div>
        <div class="col-xs-9" style="padding:0;background-color: #fff">
             <div style="margin:20px 0">
                 <span data-type="2" class="active1 spanChange">已投递</span>
                 <span data-type="3" class="spanChange">已阅读</span>
                 <span data-type="0" class="spanChange">已邀请</span>
                 <span data-type="4" class="spanChange">已上岗</span>
            </div>
            <hr>
            <div id="news"></div>
               <div id="page2" class="page"></div>
            <div id="page0" style="display: none" class="page"></div>
            <div id="page1" style="display: none" class="page"></div>
        </div>
        <div style="clear: both"></div>

    </section>
        </div>
    </div>
</div>
<!-- footer ------------------------------------------------------- -->
<div class="footer" th:include="cultivateWeb/header :: footer"></div>
<script type="text/javascript" src="/js/xlPaging.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/mobile.js"></script>
</body>
<script>
    $(function () {
        $(".spanChange").click(function () {
            $(this).addClass("active1");
            $(this).siblings().removeClass("active1");
            list($(this).attr("data-type"));
        });
        list(2);
    });
    function list(state) {
        console.log("state = " , state)
        ajaxToken("/jzApi/recruitment/selApplicationRecord", "GET", {
            current: 1,
            number: 8,
            state: state,
            t: new Date()
        }, function (r) {
            if (r.pages == 0) {
                $("#news").html('<div class="noData">暂无数据</div>');
            } else {
                var list = r.records;
                var news = '';
                list.forEach(function (item, index) {
                    news += '<div class="my_bg div_01">' +
                        '<div class="my_bg1">' +
                        '<div class="span_1"><span class="title_1">机构名称：</span><p id="type" class="title_2">' + item.orgName + '</p></div>' +
                        '<div class="span_1 my_bg2"><span class="title_1">投递职位：</span><p class="title_2">' + item.jobName + '(' + item.salaryRange + ')</p></div>' +
                        '</div>' +
                        '<div class="my_bg1">' +
                        '<div class="span_1"><span class="title_1">投递时间：</span><p class="title_2">' + item.addTime + '</p></div>' +
                        '<div class="span_1 my_bg2"><span class="title_1"><a  style="color: #fe7252"href="/cultivate/recruitInfo?id=' + item.rnewsId + '" target="_blank">查看职位详情</a></span></div>' +
                        '</div>' +
                        '</div>';
                });
                $("#news").html(news);
                page(1, r.pages, state);
            }
        })
    }
    function page(num, tolPages, state) {
        var a = '';
        if (state == 2) {
            a = '#page2';
            $("#page2").show();
            $("#page0").hide();
            $("#page1").hide();
        } else if (state == 0) {
            a = '#page0';
            $("#page2").hide();
            $("#page0").show();
            $("#page1").hide();
        } else {
            a = '#page1';
            $("#page2").hide();
            $("#page0").hide();
            $("#page1").show();
        }
        $(a).paging({
            nowPage: Number(num), // 当前页码
            pageNum: Number(tolPages), // 总页码
            buttonNum: 3, //要展示的页码数量
            canJump: 1,// 是否能跳转。0=不显示（默认），1=显示
            showOne: 0,//只有一页时，是否显示。0=不显示,1=显示（默认）
            callback: function (num) { //回调函数
                ajaxToken("/jzApi/recruitment/selApplicationRecord", "GET", {
                        current: num,
                        number: 8,
                        state: state,
                        t: new Date()
                    },
                    function (r) {
                        var list = r.records;
                        var news = '';
                        list.forEach(function (item, index) {
                            news += '<div class="my_bg div_01">' +
                                '<div style="display: flex;justify-content: space-between">' +
                                '<div class="span_1" style="flex: 6"><span class="title_1">机构名称：</span><p id="type" class="title_2">' + item.orgName + '</p></div>' +
                                '<div class="span_1" style="flex: 3;text-align: right"><span class="title_1">投递职位：</span><p class="title_2">' + item.jobName + '(' + item.salaryRange + ')</p></div>' +
                                '</div>' +
                                '<div style="display: flex;justify-content: space-between">' +
                                '<div class="span_1" style="flex: 6"><span class="title_1">投递时间：</span><p class="title_2">' + item.addTime + '</p></div>' +
                                '<div class="span_1" style="flex: 3;text-align: right"><span class="title_1"><a style="color: #fe7252" href="/cultivate/recruitInfo?id=' + item.rnewsId + '" target="_blank">查看职位详情</a></span></div>' +
                                '</div>' +
                                '</div>';
                        });
                        $("#news").html(news);
                    }
                )
            }
        })
    }
</script>
</html>
